﻿@model MvcUI.Models.ListRoleViewModel

@{
    Layout = null;
}

<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        $("[name=_role_user]").die().live("click", function () {
            $(this).find("[name=ids4]").attr("checked", "checked");
            $("#jbsxBox5").loadUrl('@Url.Action("Users", "MUserRole")', "id=" + $(this).find("[name=ids4]").val(), MyCallBack(this));
        })
        function MyCallBack(obj) {
            var $rel = $("#jbsxBox5");
            $rel.find("[layoutH]").layoutH();

        };
    });
</script>
<div class="pageHeader" style="border: 1px #B8D0D6 solid">
    @using (Html.BeginForm("RolesMaster", "MUserRole", FormMethod.Post, new { id = "pagerForm",onsubmit="return divSearch(this, 'jbsxBox4');" }))
    {
        <input type="hidden" name="pageNum" value="@Model.PagingInfo.CurrentPage" />
        <input type="hidden" name="numPerPage" value="@Model.PagingInfo.ItemsPerPage" />
        <input type="hidden" name="orderField" value="@Model.PagingInfo.OrderField" />
        <input type="hidden" name="orderDirection" value="@Model.PagingInfo.OrderDirection" />
    }
    <div class="pageHeader">
        @using (Html.BeginForm("RolesMaster", "MUserRole", FormMethod.Post, new { rel = "pagerForm", onsubmit = "return divSearch(this,'jbsxBox4');" }))
        {
            <div class="searchBar">
                <table class="searchContent">
                    <tr>
                        <td>
                            <label>
                                角色名：</label>
                            <input type="text" name="keywords" value="@Model.KeyWord" />
                        </td>
                        <td>
                            <div class="buttonActive">
                                <div class="buttonContent">
                                    <button type="submit">
                                        检索</button></div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        }
    </div>
</div>
<div class="pageContent" style="border-left: 1px #B8D0D6 solid; border-right: 1px #B8D0D6 solid">
    <div class="panelBar">
        <ul class="toolBar" style="float: right;">
            <li>
                <li><a class="edit" href="@Url.Action("AddUsers?id={sid_user}", "MUserRole")" rel="addUsersToRole" target="dialog" height="400" mask = "true" warn="请选择信息">
                    <span>添加用户</span></a></li>
            </li>
        </ul>
    </div>
    <table class="table" layouth="165" rel="jbsxBox4">
        <thead>
            <tr>
                <th width="40">
                    选择
                </th>
                <th  orderfield="Name" class="@Model.PagingInfo.OrderDirection">
                    角色名称
                </th>
                <th width="90">
                    描述
                </th>
                <th width="130">
                   备注
                </th>
                <th width="70">
                    是否可用
                </th>
               
            </tr>
        </thead>
        <tbody>
            @foreach (var s in Model.Roles)
            { 
                <tr target="sid_user" name="_role_user"  rel="@s.ID">
                    <td>
                          <input name="ids4" value="@s.ID" type="radio" >
                    </td>
                    <td>@s.Name
                    </td>
                    <td>@s.Description
                    </td>
                    <td>@s.Remark
                    </td>
                    <td>@s.Enabled
                    </td>
                    
                  
                </tr>
            }
        </tbody>
    </table>
    <div class="panelBar">
        <div class="pages">
            <span>每页显示</span>
            <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value},'jbsxBox4')">
                <option value="20">20</option>
                <option value="50">50</option>
                <option value="100">100</option>
                <option value="200">200</option>
            </select>
            <span>条，共
                @Model.PagingInfo.TotalItems
                条</span>
        </div>
        <div class="pagination" rel="jbsxBox4" totalcount="@Model.PagingInfo.TotalItems" numperpage="@Model.PagingInfo.ItemsPerPage" pagenumshown="8"
            currentpage="@Model.PagingInfo.CurrentPage">
        </div>
    </div>
</div>

